home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-09-28 | 4.7 KB | 111 lines | [TEXT/CWIE] |
- /* This file is part of the Internet Configuration system and is placed in the public domain for the benefit of all.
-
- This module implements many many tiny little routines that are of great assistance
- to those who use the Dialog Manager as a user interface. Most of these routines
- are pretty obvious, so there's not a lot of comments in the interface section.
- However there may be comments in the implementation section that you might
- find interesting.
- */
-
- #import <Dialogs.h>
-
- #if ! GENERATINGCFM
-
- // Blargh! Pascal 68K uses all upper case to make data
- // exports case insensitive. Pascal PPC exports data
- // as case sensitive. C is always case sensitive.
- // So, if I declare the variables in lower case, Pascal
- // 68K gets upset. And if I declare the variables in
- // upper case, Pascal PPC exports them in mixed case,
- // so C PPC can't see them. If I use $J+ on the Pascal
- // side, they're exported in mixed case but Pascal 68K
- // can't see them!
- //
- // Hence the yucky macros.
-
- #define gDefalutButtonUPP GDEFAULTBUTTONUPP
- #define gOKModalFilterUPP GOKMODALFILTERUPP
- #define gOKCancelModalFilter GOKCANCELMODALFILTER
- #define gOKCancelDiscardModalFilter GOKCANCELDISCARDMODALFILTER
- #endif
-
- enum {
- ditOK = 1,
- ditCancel =2,
- ditDontSave = 3
- };
-
- /* ***** Better Getters and Setters ***** */
-
- extern pascal void GetDItemText(DialogPtr dlg, SInt16 item, Str255 text);
- extern pascal void SetDItemText(DialogPtr dlg, SInt16 item, ConstStr255Param text);
-
- extern pascal void GetDItemKind(DialogPtr dlg, SInt16 item, SInt16 *kind);
- extern pascal void SetDItemKind(DialogPtr dlg, SInt16 item, SInt16 kind);
- extern pascal Handle GetDItemHandle(DialogPtr dlg, SInt16 item);
- extern pascal void SetDItemHandle(DialogPtr dlg, SInt16 item, Handle itemH);
- extern pascal void GetDItemRect(DialogPtr dlg, SInt16 item, Rect *itemRect);
- extern pascal void SetDItemRect(DialogPtr dlg, SInt16 item, const Rect *itemRect);
-
- /* ***** Dialog Control Getters and Setters ***** */
-
- extern pascal ControlHandle GetDControlHandle(DialogPtr dlg, SInt16 item);
-
- extern pascal Boolean GetDControlEnable(DialogPtr dlg, SInt16 item);
- extern pascal void SetDControlEnable(DialogPtr dlg, SInt16 item, Boolean enable);
- // extern pascal xxxx GetDControlTitle(DialogPtr dlg, SInt16 item);
- extern pascal void SetDControlTitle(DialogPtr dlg, SInt16 item, ConstStr255Param title);
- extern pascal SInt16 GetDControlValue(DialogPtr dlg, SInt16 item);
- extern pascal void SetDControlValue(DialogPtr dlg, SInt16 item, SInt16 value);
- extern pascal SInt16 GetDControlMaximum(DialogPtr dlg, SInt16 item);
- extern pascal void SetDControlMaximum(DialogPtr dlg, SInt16 item, SInt16 value);
- extern pascal Boolean GetDControlBoolean(DialogPtr dlg, SInt16 item);
- extern pascal void SetDControlBoolean(DialogPtr dlg, SInt16 item, Boolean value);
- extern pascal void ToggleDControlBoolean(DialogPtr dlg, SInt16 item);
-
- /* ***** Default Button Support ***** */
-
- extern UserItemUPP gDefaultButtonUPP;
-
- extern pascal void DefaultButtonUserItem(DialogPtr dlg, SInt16 item);
- extern pascal void SetupDefaultButtonUserItem(DialogPtr dlg, SInt16 defaultItem, SInt16 roundRectUserItem);
- /* See comment in implementation part. */
-
- /* ***** Cool Filter Functions ***** */
-
- /* Some of this functionality is subsumed by System 7's standard
- filter functions, but IC can't use them because it has to run
- under System 6.
-
- These routines are exported as both UPP and routines because
- some places in IC(such as filter functions that are layered
- on top of these default filter functions) need to call them directly.
- */
-
- extern ModalFilterUPP gOKModalFilterUPP;
- extern ModalFilterUPP gOKCancelModalFilter;
- extern ModalFilterUPP gOKCancelDiscardModalFilter;
-
- extern pascal Boolean OKModalFilter(DialogPtr dlg, EventRecord *event, SInt16 *item);
- extern pascal Boolean OKCancelModalFilter(DialogPtr dlg, EventRecord *event, SInt16 *item);
- extern pascal Boolean OKCancelDiscardModalFilter(DialogPtr dlg, EventRecord *event, SInt16 *item);
-
- /* ***** Stuff That Should Be In the Dialog Manager ***** */
-
- extern pascal SInt16 CountDItems(DialogPtr dlg);
- extern pascal SInt16 GetSelectedDialogTextItem(DialogPtr dlg);
- extern pascal Boolean DialogItemHidden(DialogPtr dlg, SInt16 item);
- extern pascal MenuHandle GetDPopupMenuHandle(DialogPtr dlg, SInt16 item);
- extern pascal void InvalDItem(DialogPtr dlg, SInt16 item);
-
- /* ***** Miscellaneous Stuff ***** */
-
- extern pascal void DrawStyledString(DialogPtr dlg, SInt16 item, ConstStr255Param styledString);
- extern pascal void ShiftTab(DialogPtr dlg);
- extern pascal void FlashDItem(DialogPtr dlg, SInt16 item);
- extern pascal Boolean TrackDItem(WindowPtr window, SInt16 item);
-
- /* ***** Initialisation ***** */
-
- extern pascal void InitICDialogs(void);
-